<template>
	<view  class="main">
        <navbar :title="title"  :background="$utypeprimary" :titleColor="$utitlecolor" :backColor="$utitlecolor">></navbar>
        <view v-html="content"></view>
	</view>
</template>

<script>
	import {
		settingList
	} from '@/api/home.js'
	export default {
		components: {
		},
		data() {
			return {
                title: '',
                content: '',
			}
		},
		async onLoad(option) {
            let result = await this.load();
            const type = option.type;
            switch (type) {
                case 'privacy':
                    this.title = 'Privacy agreement';
                    this.content = result.private_policy
                    break;
                case 'user':
                    this.title = 'User agreement';
                    this.content = result.user_protocol
                    break;
                case 'level':
                    this.title = 'Rule';
                    this.content = result.level_rule
                    break;
                case 'team':
                    this.title = 'Team rule';
                    this.content = result.team_rule
                    break;
                case 'invite':
                    this.title = 'Invite rule';
                    this.content = result.invite_rule
                    break;
                case 'quick':
                    this.title = 'Quick guide';
                    this.content = result.quick_guide
                    break;
                case 'protocol':
                    this.title = 'Customer Agreement';
                    this.content = result.protocol
                    break;
                case 'privilege':
                    this.title = 'Customer Rights';
                    this.content = result.privilege
                    break;
                case 'financerule':
                    this.title = 'Financial Rules';
                    this.content = result.finance_rule
                    break;
                case 'missionrule':
                    this.title = 'Tasks Rules';
                    this.content = result.cash_rule
                    break;

                default:
                    break;
            }
		},
		onReady() {
		},
		onShow() {
		},
		computed: {
            systemInfo() {
                return this.$store.getters.systemInfo || {}
            }
		},
		watch: {
		},
		methods: {
            async load() {
                let result = await settingList();
                return result;
            }
		},
		onHide() {
		},
		destroyed() {
		},
		onPullDownRefresh() {
		},
		onPageScroll(e) {
		},
	}
</script>

<style lang="scss" scoped>
    .main {
        padding: 40rpx;
    }
</style>
